package com.crm.customer.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
//import javax.servlet.http.HttpSession;

import com.crm.customer.model.Customer;
import com.service.CustomerService;

public class CustomerListController extends HttpServlet{
	/**
	 * 
	 */
	private static final long serialVersionUID = -2718769641940917173L;

	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		CustomerService model = new CustomerService();
		List<Customer> customers = model.queryCustomer();
		req.setAttribute("customers", customers);
		
		//HttpSession session = req.getSession();
		
		req.getRequestDispatcher("/View/CustomerList.jsp").forward(req, resp);
	}
}

